#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main() {
	int n = 0;
	int arr[1000] = { 0 };
	while (scanf("%d", &n) != 0){
		n--;
		scanf("%d ", arr[n]);
	}
	printf("%d ", arr[n]);
	return 0;
}